//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS SecurityIR service.
///
/// This guide provides documents the action and response elements for customer use of the service.
public struct SecurityIR: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the SecurityIR client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "SecurityIR",
            serviceIdentifier: "security-ir",
            serviceProtocol: .restjson,
            apiVersion: "2018-05-10",
            endpoint: endpoint,
            errorType: SecurityIRErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Grants permission to view an existing membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_BatchGetMemberAccountDetails.html
    @Sendable
    @inlinable
    public func batchGetMemberAccountDetails(_ input: BatchGetMemberAccountDetailsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> BatchGetMemberAccountDetailsResponse {
        try await self.client.execute(
            operation: "BatchGetMemberAccountDetails", 
            path: "/v1/membership/{membershipId}/batch-member-details", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to view an existing membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_BatchGetMemberAccountDetails.html
    ///
    /// Parameters:
    ///   - accountIds: Optional element to query the membership relationship status to a provided list of account IDs.
    ///   - membershipId: Required element used in combination with BatchGetMemberAccountDetails to identify the membership ID to query.
    ///   - logger: Logger use during operation
    @inlinable
    public func batchGetMemberAccountDetails(
        accountIds: [String],
        membershipId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BatchGetMemberAccountDetailsResponse {
        let input = BatchGetMemberAccountDetailsRequest(
            accountIds: accountIds, 
            membershipId: membershipId
        )
        return try await self.batchGetMemberAccountDetails(input, logger: logger)
    }

    /// Grants permissions to cancel an existing membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CancelMembership.html
    @Sendable
    @inlinable
    public func cancelMembership(_ input: CancelMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelMembershipResponse {
        try await self.client.execute(
            operation: "CancelMembership", 
            path: "/v1/membership/{membershipId}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permissions to cancel an existing membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CancelMembership.html
    ///
    /// Parameters:
    ///   - membershipId: Required element used in combination with CancelMembershipRequest to identify the membership ID to cancel.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelMembership(
        membershipId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelMembershipResponse {
        let input = CancelMembershipRequest(
            membershipId: membershipId
        )
        return try await self.cancelMembership(input, logger: logger)
    }

    /// Grants permission to close an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CloseCase.html
    @Sendable
    @inlinable
    public func closeCase(_ input: CloseCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CloseCaseResponse {
        try await self.client.execute(
            operation: "CloseCase", 
            path: "/v1/cases/{caseId}/close-case", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to close an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CloseCase.html
    ///
    /// Parameters:
    ///   - caseId: Required element used in combination with CloseCase to identify the case ID to close.
    ///   - logger: Logger use during operation
    @inlinable
    public func closeCase(
        caseId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CloseCaseResponse {
        let input = CloseCaseRequest(
            caseId: caseId
        )
        return try await self.closeCase(input, logger: logger)
    }

    /// Grants permission to create a new case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateCase.html
    @Sendable
    @inlinable
    public func createCase(_ input: CreateCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateCaseResponse {
        try await self.client.execute(
            operation: "CreateCase", 
            path: "/v1/create-case", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to create a new case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateCase.html
    ///
    /// Parameters:
    ///   - clientToken: Required element used in combination with CreateCase.
    ///   - description: Required element used in combination with CreateCase to provide a description for the new case.
    ///   - engagementType: Required element used in combination with CreateCase to provide an engagement type for the new cases. Available engagement types include Security Incident | Investigation
    ///   - impactedAccounts: Required element used in combination with CreateCase to provide a list of impacted accounts.
    ///   - impactedAwsRegions: An optional element used in combination with CreateCase to provide a list of impacted regions.
    ///   - impactedServices: An optional element used in combination with CreateCase to provide a list of services impacted.
    ///   - reportedIncidentStartDate: Required element used in combination with CreateCase to provide an initial start date for the unauthorized activity.
    ///   - resolverType: Required element used in combination with CreateCase to identify the resolver type. Available resolvers include self-supported | aws-supported.
    ///   - tags: An optional element used in combination with CreateCase to add customer specified tags to a case.
    ///   - threatActorIpAddresses: An optional element used in combination with CreateCase to provide a list of suspicious internet protocol addresses associated with unauthorized activity.
    ///   - title: Required element used in combination with CreateCase to provide a title for the new case.
    ///   - watchers: Required element used in combination with CreateCase to provide a list of entities to receive notifications for case updates.
    ///   - logger: Logger use during operation
    @inlinable
    public func createCase(
        clientToken: String? = nil,
        description: String,
        engagementType: EngagementType,
        impactedAccounts: [String],
        impactedAwsRegions: [ImpactedAwsRegion]? = nil,
        impactedServices: [String]? = nil,
        reportedIncidentStartDate: Date,
        resolverType: ResolverType,
        tags: [String: String]? = nil,
        threatActorIpAddresses: [ThreatActorIp]? = nil,
        title: String,
        watchers: [Watcher],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateCaseResponse {
        let input = CreateCaseRequest(
            clientToken: clientToken, 
            description: description, 
            engagementType: engagementType, 
            impactedAccounts: impactedAccounts, 
            impactedAwsRegions: impactedAwsRegions, 
            impactedServices: impactedServices, 
            reportedIncidentStartDate: reportedIncidentStartDate, 
            resolverType: resolverType, 
            tags: tags, 
            threatActorIpAddresses: threatActorIpAddresses, 
            title: title, 
            watchers: watchers
        )
        return try await self.createCase(input, logger: logger)
    }

    /// Grants permission to add a comment to an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateCaseComment.html
    @Sendable
    @inlinable
    public func createCaseComment(_ input: CreateCaseCommentRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateCaseCommentResponse {
        try await self.client.execute(
            operation: "CreateCaseComment", 
            path: "/v1/cases/{caseId}/create-comment", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to add a comment to an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateCaseComment.html
    ///
    /// Parameters:
    ///   - body: Required element used in combination with CreateCaseComment to add content for the new comment.
    ///   - caseId: Required element used in combination with CreateCaseComment to specify a case ID.
    ///   - clientToken: An optional element used in combination with CreateCaseComment.
    ///   - logger: Logger use during operation
    @inlinable
    public func createCaseComment(
        body: String,
        caseId: String,
        clientToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateCaseCommentResponse {
        let input = CreateCaseCommentRequest(
            body: body, 
            caseId: caseId, 
            clientToken: clientToken
        )
        return try await self.createCaseComment(input, logger: logger)
    }

    /// Grants permissions to create a new membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateMembership.html
    @Sendable
    @inlinable
    public func createMembership(_ input: CreateMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateMembershipResponse {
        try await self.client.execute(
            operation: "CreateMembership", 
            path: "/v1/membership", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permissions to create a new membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_CreateMembership.html
    ///
    /// Parameters:
    ///   - clientToken: An optional element used in combination with CreateMembership.
    ///   - incidentResponseTeam: Required element use in combination with CreateMembership to add customer incident response team members and trusted partners to the membership.
    ///   - membershipName: Required element use in combination with CreateMembership to create a name for the membership.
    ///   - optInFeatures: Optional element to enable the monitoring and investigation opt-in features for the service.
    ///   - tags: Optional element for customer configured tags.
    ///   - logger: Logger use during operation
    @inlinable
    public func createMembership(
        clientToken: String? = nil,
        incidentResponseTeam: [IncidentResponder],
        membershipName: String,
        optInFeatures: [OptInFeature]? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateMembershipResponse {
        let input = CreateMembershipRequest(
            clientToken: clientToken, 
            incidentResponseTeam: incidentResponseTeam, 
            membershipName: membershipName, 
            optInFeatures: optInFeatures, 
            tags: tags
        )
        return try await self.createMembership(input, logger: logger)
    }

    /// Grant permission to view a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCase.html
    @Sendable
    @inlinable
    public func getCase(_ input: GetCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCaseResponse {
        try await self.client.execute(
            operation: "GetCase", 
            path: "/v1/cases/{caseId}/get-case", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grant permission to view a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCase.html
    ///
    /// Parameters:
    ///   - caseId: Required element for GetCase to identify the requested case ID.
    ///   - logger: Logger use during operation
    @inlinable
    public func getCase(
        caseId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCaseResponse {
        let input = GetCaseRequest(
            caseId: caseId
        )
        return try await self.getCase(input, logger: logger)
    }

    /// Grants permission to obtain an Amazon S3 presigned URL to download an attachment.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCaseAttachmentDownloadUrl.html
    @Sendable
    @inlinable
    public func getCaseAttachmentDownloadUrl(_ input: GetCaseAttachmentDownloadUrlRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCaseAttachmentDownloadUrlResponse {
        try await self.client.execute(
            operation: "GetCaseAttachmentDownloadUrl", 
            path: "/v1/cases/{caseId}/get-presigned-url/{attachmentId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to obtain an Amazon S3 presigned URL to download an attachment.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCaseAttachmentDownloadUrl.html
    ///
    /// Parameters:
    ///   - attachmentId: Required element for GetCaseAttachmentDownloadUrl to identify the attachment ID for downloading an attachment.
    ///   - caseId: Required element for GetCaseAttachmentDownloadUrl to identify the case ID for downloading an attachment from.
    ///   - logger: Logger use during operation
    @inlinable
    public func getCaseAttachmentDownloadUrl(
        attachmentId: String,
        caseId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCaseAttachmentDownloadUrlResponse {
        let input = GetCaseAttachmentDownloadUrlRequest(
            attachmentId: attachmentId, 
            caseId: caseId
        )
        return try await self.getCaseAttachmentDownloadUrl(input, logger: logger)
    }

    /// Grants permission to upload an attachment to a case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCaseAttachmentUploadUrl.html
    @Sendable
    @inlinable
    public func getCaseAttachmentUploadUrl(_ input: GetCaseAttachmentUploadUrlRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCaseAttachmentUploadUrlResponse {
        try await self.client.execute(
            operation: "GetCaseAttachmentUploadUrl", 
            path: "/v1/cases/{caseId}/get-presigned-url", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to upload an attachment to a case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetCaseAttachmentUploadUrl.html
    ///
    /// Parameters:
    ///   - caseId: Required element for GetCaseAttachmentUploadUrl to identify the case ID for uploading an attachment to.
    ///   - clientToken: Optional element for customer provided token.
    ///   - contentLength: Required element for GetCaseAttachmentUploadUrl to identify the size od the file attachment.
    ///   - fileName: Required element for GetCaseAttachmentUploadUrl to identify the file name of the attachment to upload.
    ///   - logger: Logger use during operation
    @inlinable
    public func getCaseAttachmentUploadUrl(
        caseId: String,
        clientToken: String? = nil,
        contentLength: Int64,
        fileName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCaseAttachmentUploadUrlResponse {
        let input = GetCaseAttachmentUploadUrlRequest(
            caseId: caseId, 
            clientToken: clientToken, 
            contentLength: contentLength, 
            fileName: fileName
        )
        return try await self.getCaseAttachmentUploadUrl(input, logger: logger)
    }

    /// Grants permission to get details of a designated service membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetMembership.html
    @Sendable
    @inlinable
    public func getMembership(_ input: GetMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetMembershipResponse {
        try await self.client.execute(
            operation: "GetMembership", 
            path: "/v1/membership/{membershipId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to get details of a designated service membership.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_GetMembership.html
    ///
    /// Parameters:
    ///   - membershipId: Required element for GetMembership to identify the membership ID to query.
    ///   - logger: Logger use during operation
    @inlinable
    public func getMembership(
        membershipId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetMembershipResponse {
        let input = GetMembershipRequest(
            membershipId: membershipId
        )
        return try await self.getMembership(input, logger: logger)
    }

    /// Grants permissions to view the aidt log for edits made to a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListCaseEdits.html
    @Sendable
    @inlinable
    public func listCaseEdits(_ input: ListCaseEditsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListCaseEditsResponse {
        try await self.client.execute(
            operation: "ListCaseEdits", 
            path: "/v1/cases/{caseId}/list-case-edits", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permissions to view the aidt log for edits made to a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListCaseEdits.html
    ///
    /// Parameters:
    ///   - caseId: Required element used with ListCaseEdits to identify the case to query.
    ///   - maxResults: Optional element to identify how many results to obtain. There is a maximum value of 25.
    ///   - nextToken: Optional element for a customer provided token.
    ///   - logger: Logger use during operation
    @inlinable
    public func listCaseEdits(
        caseId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListCaseEditsResponse {
        let input = ListCaseEditsRequest(
            caseId: caseId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listCaseEdits(input, logger: logger)
    }

    /// Grants permission to list all cases the requester has access to.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListCases.html
    @Sendable
    @inlinable
    public func listCases(_ input: ListCasesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListCasesResponse {
        try await self.client.execute(
            operation: "ListCases", 
            path: "/v1/list-cases", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to list all cases the requester has access to.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListCases.html
    ///
    /// Parameters:
    ///   - maxResults: Optional element for ListCases to limit the number of responses.
    ///   - nextToken: Optional element.
    ///   - logger: Logger use during operation
    @inlinable
    public func listCases(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListCasesResponse {
        let input = ListCasesRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listCases(input, logger: logger)
    }

    /// Grants permissions to list and view comments for a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListComments.html
    @Sendable
    @inlinable
    public func listComments(_ input: ListCommentsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListCommentsResponse {
        try await self.client.execute(
            operation: "ListComments", 
            path: "/v1/cases/{caseId}/list-comments", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permissions to list and view comments for a designated case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListComments.html
    ///
    /// Parameters:
    ///   - caseId: Required element for ListComments to designate the case to query.
    ///   - maxResults: Optional element for ListComments to limit the number of responses.
    ///   - nextToken: Optional element.
    ///   - logger: Logger use during operation
    @inlinable
    public func listComments(
        caseId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListCommentsResponse {
        let input = ListCommentsRequest(
            caseId: caseId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listComments(input, logger: logger)
    }

    /// Grants permission to query the memberships a principal has access to.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListMemberships.html
    @Sendable
    @inlinable
    public func listMemberships(_ input: ListMembershipsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListMembershipsResponse {
        try await self.client.execute(
            operation: "ListMemberships", 
            path: "/v1/memberships", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to query the memberships a principal has access to.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListMemberships.html
    ///
    /// Parameters:
    ///   - maxResults: Request element for ListMemberships to limit the number of responses.
    ///   - nextToken: Optional element.
    ///   - logger: Logger use during operation
    @inlinable
    public func listMemberships(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListMembershipsResponse {
        let input = ListMembershipsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listMemberships(input, logger: logger)
    }

    /// Grants permission to view currently configured tags on a resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListTagsForResource.html
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceOutput {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/v1/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to view currently configured tags on a resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_ListTagsForResource.html
    ///
    /// Parameters:
    ///   - resourceArn: Required element for ListTagsForResource to provide the ARN to identify a specific resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceOutput {
        let input = ListTagsForResourceInput(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Grants permission to add a tag(s) to a designated resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_TagResource.html
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceOutput {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/v1/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to add a tag(s) to a designated resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_TagResource.html
    ///
    /// Parameters:
    ///   - resourceArn: Required element for TagResource to identify the ARN for the resource to add a tag to.
    ///   - tags: Required element for ListTagsForResource to provide the content for a tag.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceOutput {
        let input = TagResourceInput(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Grants permission to remove a tag(s) from a designate resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UntagResource.html
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceInput, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceOutput {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/v1/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to remove a tag(s) from a designate resource.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UntagResource.html
    ///
    /// Parameters:
    ///   - resourceArn: Required element for UnTagResource to identify the ARN for the resource to remove a tag from.
    ///   - tagKeys: Required element for UnTagResource to identify tag to remove.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceOutput {
        let input = UntagResourceInput(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Grants permission to update an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCase.html
    @Sendable
    @inlinable
    public func updateCase(_ input: UpdateCaseRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateCaseResponse {
        try await self.client.execute(
            operation: "UpdateCase", 
            path: "/v1/cases/{caseId}/update-case", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to update an existing case.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCase.html
    ///
    /// Parameters:
    ///   - actualIncidentStartDate: Optional element for UpdateCase to provide content for the incident start date field.
    ///   - caseId: Required element for UpdateCase to identify the case ID for updates.
    ///   - description: Optional element for UpdateCase to provide content for the description field.
    ///   - engagementType: Optional element for UpdateCase to provide content for the engagement type field. Available engagement types include Security Incident | Investigation.
    ///   - impactedAccountsToAdd: Optional element for UpdateCase to provide content to add accounts impacted.
    ///   - impactedAccountsToDelete: Optional element for UpdateCase to provide content to add accounts impacted.
    ///   - impactedAwsRegionsToAdd: Optional element for UpdateCase to provide content to add regions impacted.
    ///   - impactedAwsRegionsToDelete: Optional element for UpdateCase to provide content to remove regions impacted.
    ///   - impactedServicesToAdd: Optional element for UpdateCase to provide content to add services impacted.
    ///   - impactedServicesToDelete: Optional element for UpdateCase to provide content to remove services impacted.
    ///   - reportedIncidentStartDate: Optional element for UpdateCase to provide content for the customer reported incident start date field.
    ///   - threatActorIpAddressesToAdd: Optional element for UpdateCase to provide content to add additional suspicious IP addresses related to a case.
    ///   - threatActorIpAddressesToDelete: Optional element for UpdateCase to provide content to remove suspicious IP addresses from a case.
    ///   - title: Optional element for UpdateCase to provide content for the title field.
    ///   - watchersToAdd: Optional element for UpdateCase to provide content to add additional watchers to a case.
    ///   - watchersToDelete: Optional element for UpdateCase to provide content to remove existing watchers from a case.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCase(
        actualIncidentStartDate: Date? = nil,
        caseId: String,
        description: String? = nil,
        engagementType: EngagementType? = nil,
        impactedAccountsToAdd: [String]? = nil,
        impactedAccountsToDelete: [String]? = nil,
        impactedAwsRegionsToAdd: [ImpactedAwsRegion]? = nil,
        impactedAwsRegionsToDelete: [ImpactedAwsRegion]? = nil,
        impactedServicesToAdd: [String]? = nil,
        impactedServicesToDelete: [String]? = nil,
        reportedIncidentStartDate: Date? = nil,
        threatActorIpAddressesToAdd: [ThreatActorIp]? = nil,
        threatActorIpAddressesToDelete: [ThreatActorIp]? = nil,
        title: String? = nil,
        watchersToAdd: [Watcher]? = nil,
        watchersToDelete: [Watcher]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateCaseResponse {
        let input = UpdateCaseRequest(
            actualIncidentStartDate: actualIncidentStartDate, 
            caseId: caseId, 
            description: description, 
            engagementType: engagementType, 
            impactedAccountsToAdd: impactedAccountsToAdd, 
            impactedAccountsToDelete: impactedAccountsToDelete, 
            impactedAwsRegionsToAdd: impactedAwsRegionsToAdd, 
            impactedAwsRegionsToDelete: impactedAwsRegionsToDelete, 
            impactedServicesToAdd: impactedServicesToAdd, 
            impactedServicesToDelete: impactedServicesToDelete, 
            reportedIncidentStartDate: reportedIncidentStartDate, 
            threatActorIpAddressesToAdd: threatActorIpAddressesToAdd, 
            threatActorIpAddressesToDelete: threatActorIpAddressesToDelete, 
            title: title, 
            watchersToAdd: watchersToAdd, 
            watchersToDelete: watchersToDelete
        )
        return try await self.updateCase(input, logger: logger)
    }

    /// Grants permission to update an existing case comment.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCaseComment.html
    @Sendable
    @inlinable
    public func updateCaseComment(_ input: UpdateCaseCommentRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateCaseCommentResponse {
        try await self.client.execute(
            operation: "UpdateCaseComment", 
            path: "/v1/cases/{caseId}/update-case-comment/{commentId}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to update an existing case comment.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCaseComment.html
    ///
    /// Parameters:
    ///   - body: Required element for UpdateCaseComment to identify the content for the comment to be updated.
    ///   - caseId: Required element for UpdateCaseComment to identify the case ID containing the comment to be updated.
    ///   - commentId: Required element for UpdateCaseComment to identify the case ID to be updated.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCaseComment(
        body: String,
        caseId: String,
        commentId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateCaseCommentResponse {
        let input = UpdateCaseCommentRequest(
            body: body, 
            caseId: caseId, 
            commentId: commentId
        )
        return try await self.updateCaseComment(input, logger: logger)
    }

    /// Grants permission to update the status for a designated cases. Options include Submitted | Detection and Analysis | Eradication, Containment and Recovery | Post-Incident Activities | Closed.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCaseStatus.html
    @Sendable
    @inlinable
    public func updateCaseStatus(_ input: UpdateCaseStatusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateCaseStatusResponse {
        try await self.client.execute(
            operation: "UpdateCaseStatus", 
            path: "/v1/cases/{caseId}/update-case-status", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to update the status for a designated cases. Options include Submitted | Detection and Analysis | Eradication, Containment and Recovery | Post-Incident Activities | Closed.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateCaseStatus.html
    ///
    /// Parameters:
    ///   - caseId: Required element for UpdateCaseStatus to identify the case to update.
    ///   - caseStatus: Required element for UpdateCaseStatus to identify the status for a case. Options include Submitted | Detection and Analysis | Containment, Eradication and Recovery | Post-incident Activities.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateCaseStatus(
        caseId: String,
        caseStatus: SelfManagedCaseStatus,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateCaseStatusResponse {
        let input = UpdateCaseStatusRequest(
            caseId: caseId, 
            caseStatus: caseStatus
        )
        return try await self.updateCaseStatus(input, logger: logger)
    }

    /// Grants access to UpdateMembership to change membership configuration.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateMembership.html
    @Sendable
    @inlinable
    public func updateMembership(_ input: UpdateMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateMembershipResponse {
        try await self.client.execute(
            operation: "UpdateMembership", 
            path: "/v1/membership/{membershipId}/update-membership", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants access to UpdateMembership to change membership configuration.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateMembership.html
    ///
    /// Parameters:
    ///   - incidentResponseTeam: Optional element for UpdateMembership to update the membership name.
    ///   - membershipId: Required element for UpdateMembership to identify the membership to update.
    ///   - membershipName: Optional element for UpdateMembership to update the membership name.
    ///   - optInFeatures: Optional element for UpdateMembership to enable or disable opt-in features for the service.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateMembership(
        incidentResponseTeam: [IncidentResponder]? = nil,
        membershipId: String,
        membershipName: String? = nil,
        optInFeatures: [OptInFeature]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateMembershipResponse {
        let input = UpdateMembershipRequest(
            incidentResponseTeam: incidentResponseTeam, 
            membershipId: membershipId, 
            membershipName: membershipName, 
            optInFeatures: optInFeatures
        )
        return try await self.updateMembership(input, logger: logger)
    }

    /// Grants permission to update the resolver type for a case.  This is a one-way action and cannot be reversed.  Options include self-supported &gt; AWS-supported.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateResolverType.html
    @Sendable
    @inlinable
    public func updateResolverType(_ input: UpdateResolverTypeRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateResolverTypeResponse {
        try await self.client.execute(
            operation: "UpdateResolverType", 
            path: "/v1/cases/{caseId}/update-resolver-type", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Grants permission to update the resolver type for a case.  This is a one-way action and cannot be reversed.  Options include self-supported &gt; AWS-supported.
    /// API Reference: https://docs.aws.amazon.com/security-ir/latest/APIReference/API_UpdateResolverType.html
    ///
    /// Parameters:
    ///   - caseId: Required element for UpdateResolverType to identify the case to update.
    ///   - resolverType: Required element for UpdateResolverType to identify the new resolver.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateResolverType(
        caseId: String,
        resolverType: ResolverType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateResolverTypeResponse {
        let input = UpdateResolverTypeRequest(
            caseId: caseId, 
            resolverType: resolverType
        )
        return try await self.updateResolverType(input, logger: logger)
    }
}

extension SecurityIR {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: SecurityIR, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension SecurityIR {
    /// Return PaginatorSequence for operation ``listCaseEdits(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listCaseEditsPaginator(
        _ input: ListCaseEditsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListCaseEditsRequest, ListCaseEditsResponse> {
        return .init(
            input: input,
            command: self.listCaseEdits,
            inputKey: \ListCaseEditsRequest.nextToken,
            outputKey: \ListCaseEditsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listCaseEdits(_:logger:)``.
    ///
    /// - Parameters:
    ///   - caseId: Required element used with ListCaseEdits to identify the case to query.
    ///   - maxResults: Optional element to identify how many results to obtain. There is a maximum value of 25.
    ///   - logger: Logger used for logging
    @inlinable
    public func listCaseEditsPaginator(
        caseId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListCaseEditsRequest, ListCaseEditsResponse> {
        let input = ListCaseEditsRequest(
            caseId: caseId, 
            maxResults: maxResults
        )
        return self.listCaseEditsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listCases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listCasesPaginator(
        _ input: ListCasesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListCasesRequest, ListCasesResponse> {
        return .init(
            input: input,
            command: self.listCases,
            inputKey: \ListCasesRequest.nextToken,
            outputKey: \ListCasesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listCases(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Optional element for ListCases to limit the number of responses.
    ///   - logger: Logger used for logging
    @inlinable
    public func listCasesPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListCasesRequest, ListCasesResponse> {
        let input = ListCasesRequest(
            maxResults: maxResults
        )
        return self.listCasesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listComments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listCommentsPaginator(
        _ input: ListCommentsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListCommentsRequest, ListCommentsResponse> {
        return .init(
            input: input,
            command: self.listComments,
            inputKey: \ListCommentsRequest.nextToken,
            outputKey: \ListCommentsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listComments(_:logger:)``.
    ///
    /// - Parameters:
    ///   - caseId: Required element for ListComments to designate the case to query.
    ///   - maxResults: Optional element for ListComments to limit the number of responses.
    ///   - logger: Logger used for logging
    @inlinable
    public func listCommentsPaginator(
        caseId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListCommentsRequest, ListCommentsResponse> {
        let input = ListCommentsRequest(
            caseId: caseId, 
            maxResults: maxResults
        )
        return self.listCommentsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listMemberships(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listMembershipsPaginator(
        _ input: ListMembershipsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListMembershipsRequest, ListMembershipsResponse> {
        return .init(
            input: input,
            command: self.listMemberships,
            inputKey: \ListMembershipsRequest.nextToken,
            outputKey: \ListMembershipsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listMemberships(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: Request element for ListMemberships to limit the number of responses.
    ///   - logger: Logger used for logging
    @inlinable
    public func listMembershipsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListMembershipsRequest, ListMembershipsResponse> {
        let input = ListMembershipsRequest(
            maxResults: maxResults
        )
        return self.listMembershipsPaginator(input, logger: logger)
    }
}

extension SecurityIR.ListCaseEditsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> SecurityIR.ListCaseEditsRequest {
        return .init(
            caseId: self.caseId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension SecurityIR.ListCasesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> SecurityIR.ListCasesRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension SecurityIR.ListCommentsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> SecurityIR.ListCommentsRequest {
        return .init(
            caseId: self.caseId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension SecurityIR.ListMembershipsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> SecurityIR.ListMembershipsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
